on *:load {
  set %trigger !fserv
  set %trigger2 !script
  set %status 0
  set %adv 0
  set %reason i don't like you
  set %dir c:\mirc\
  set %chan #
  echo You just loaded 0,1 .[BytD].  Fserv.
  echo You need to set a Fserv directory, a Fserv channel and a welcome message before this Fserv will function.
}

on *:text:%trigger2:#: {
  /dcc send $nick fserv.mrc
}

on *:text:%trigger:#: {
  if ($nick != %hate1) && ($nick != %hate2) && ($nick != %hate3) && ($nick != %hate4) && ($nick != %hate5) {
    if (%status == 1)  {
      if ($chan == %chan)  {
        fserve $nick 1 %dir welcome.txt
      }
      else {
        /msg $nick You cannot use this Fserv because it is set for channel %chan.  0,1 .[BytD].       
      }
    }
    else {
      /msg $nick You cannot use this Fserv because it is switched off. 0,1 .[BytD]. 
    }
  }
  else {
    /msg $nick You cannot use this Fserv because %reason  0,1 .[BytD]. 
  }
}

on *:join:*: {
  if ($nick != $me) && ($nick == BytD)  {
    /notice BytD I'm using your Fserv 0,1 .[BytD]. 
  }
  else  {
    halt
  }
}
menu status,channel,nicklist {
  Fserv
  .Status
  ..On:{
    set %status 1
    echo Fserv ON 0,1 .[BytD]. 
    /go
  }
  ..Off:{
    set %status 0
    echo Fserv OFF  0,1 .[BytD]. 
    /stop
  }
  .Advertising
  ..On: {
    set %adv 1
    echo Advertising ON  0,1 .[BytD]. 
    /go
  }
  ..Off:{
    set %adv 1
    echo Advertising OFF  0,1 .[BytD]. 
    /stop
  }
  .Hate
  ..List Nicks: {
    echo People who cannot use this Fserv. 0,1 .[BytD]. 
    echo Nick 1 - %hate1
    echo Nick 2 - %hate2
    echo Nick 3 - %hate3
    echo Nick 4 - %hate4
    echo Nick 5 - %hate5
  }
  ..Reason:{
    set %reason $$?="You cannot use the fserv because..."
    echo Message displayed when hated user attempts to use Fserv
    echo - You cannot use this Fserv because %reason  0,1 .[BytD]. 
  }
  ..Unhate All: {
    unset %hate1
    unset %hate2
    unset %hate3
    unset %hate4
    unset %hate5
    echo Everyone can now use this Fserv  0,1 .[BytD]. 
  }
  ..-
  ..Nick1:{
    if (%hate1 == $null) {
      set %hate1 $$?="Hated Nick 1"
    }
    else {
      echo This slot is filled by %hate1 , either clear it or use another.  0,1 .[BytD]. 
    }
  }
  ..Nick2:{
    if (%hate2 == $null) {
      set %hate2 $$?="Hated Nick 2"
    }
    else {
      echo This slot is filled by %hate2 , either clear it or use another.  0,1 .[BytD]. 
    }
  } 
  ..Nick3:{
    if (%hate3 == $null) {
      set %hate3 $$?="Hated Nick 3"
    }
    else {
      echo This slot is filled by %hate3 , either clear it or use another.  0,1 .[BytD]. 
    }
  }  
  ..Nick4:{
    if (%hate4 == $null) {
      set %hate4 $$?="Hated Nick 4"
    }
    else {
      echo This slot is filled by %hate4 , either clear it or use another.  0,1 .[BytD]. 
    }
  }
  ..Nick5:{
    if (%hate5 == $null) {
      set %hate5 $$?="Hated Nick 5"
    }
    else {
      echo This slot is filled by %hate5 , either clear it or use another.  0,1 .[BytD]. 
    }
  }
  ..-
  ..Unhate Nick 1: {
    if (%hate1 == $null) {
      echo Slot 1 was already empty.  0,1 .[BytD]. 
    }
    else {
      echo %hate1 can now use this Fserv.  0,1 .[BytD]. 
      unset %hate1
    }
  }
  ..Unhate Nick 2: {
    if (%hate2 == $null) {
      echo Slot 2 was already empty.  0,1 .[BytD]. 
    }
    else {
      echo %hate2 can now use this Fserv.  0,1 .[BytD]. 
      unset %hate2
    }
  }
  ..Unhate Nick 3: {
    if (%hate3 == $null) {
      echo Slot 3 was already empty.  0,1 .[BytD]. 
    }
    else {
      echo %hate3 can now use this Fserv.  0,1 .[BytD]. 
      unset %hate3
    }
  }
  ..Unhate Nick 4: {
    if (%hate4 == $null) {
      echo Slot 4 was already empty.  0,1 .[BytD]. 
    }
    else {
      echo %hate4 can now use this Fserv.  0,1 .[BytD]. 
      unset %hate4
    }
  }
  ..Unhate Nick 5: {
    if (%hate5 == $null) {
      echo Slot 5 was already empty.  0,1 .[BytD]. 
    }
    else {
      echo %hate5 can now use this Fserv.  0,1 .[BytD]. 
      unset %hate5
    }
  }
  .-
  .Set Trigger: {
    set %trigger $$?="Trigger (eg. !fserv)"
    /echo Trigger is now %trigger 0,1 .[BytD]. 
  }
  .Set Script Trigger: {
    set %trigger2 $$?="Script trigger (eg. !script)"
    /echo Script Trigger is now %trigger2 0,1 .[BytD]. 
  }
  .Set Channel: {
    set %chan $chan
    if (%chan == $null)  {
      echo No Fserv channel.  Fserv will not function.  0,1 .[BytD]. 
    }
    else    {
      echo Fserv channel is now $chan  0,1 .[BytD]. 
    }
  }
  .Set Directory: {
    set %dir $$?="Fserv Directory"
    if (%dir == $null) {
      echo No Fserv directory.  Fserv will not function.  0,1 .[BytD]. 
    }
    else {
      echo Fserv directory is now %dir 0,1 .[BytD]. 
    }
  }
  .Edit Welcome Message: {
    run notepad.exe welcome.txt
  }
  .-
  .About: {
    echo 
    echo -
    echo 
    echo About: Written by BytD, Fserv version 1.1. 0,1 .[BytD]. 
    echo To speak to the author please visit, /server irc.labyrinth.net.au and /join #mpeg3
  }
}
alias one {
  if (%status == 1) && (%adv == 1) {
    /msg %chan 0,1 -= Fserv:  %trigger  =-  0,1  -= Fserv Script:  %trigger2 =-  0,1 .[BytD]. 
  }
  else {
    halt
  }
}
alias go {
  if (%status == 1) && (%adv == 1) {
    /msg %chan 0,1 -= Fserv:  %trigger  =-  0,1  -= Fserv Script:  %trigger2 =-  0,1 .[BytD]. 
    timerfserv 0 300 /msg %chan 0,1 -= Fserv:  %trigger  =-  0,1  -= Fserv Script:  %trigger2 =-  0,1 .[BytD]. 
  }
  else {
    halt
  }
}
alias stop {
  timerfserv off
}

